import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method("POST")
        url("/api/auth/username")
        headers {
            header('Content-Type', 'application/json;charset=UTF-8')
        }
        body("""
            {
                "username":"admin",
                "password":"12345678"
            }
        """)
    }
    response {
        status(200)
        body("""
            {
                "jwt":"123asdasddd1114",
            }
        """)
        bodyMatchers {
            jsonPath('$.jwt', byType())
        }
        headers {
            contentType(applicationJsonUtf8())
        }
    }
}
